-
Notifications
You must be signed in to change notification settings - Fork 531
SNOW-1825621 refresh token implementation and OAuth token cache #2162
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SNOW-1825621 refresh token implementation and OAuth token cache #2162
Conversation
7f15277 to
7a861c1
Compare
sfc-gh-eworoshow
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
| ), | ||
| "oauth_security_features": ( | ||
| ("pkce",), | ||
| ("pkce", "refresh_token"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should omit refresh_token from the default, since the default oauth integration will not have refresh tokens enabled unless the admin turns them on explicitly
| logger.info( | ||
| "oauth refresh token is available, going to try consuming it to recover" | ||
| ) | ||
| self._consume_refresh_token(conn=conn) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we only need to use the refresh token after the access token has expired, in order to create a new session without reprompting for credentials
Co-authored-by: Michał Hofman <[email protected]>
Co-authored-by: Mark Keller <[email protected]> Co-authored-by: Michał Hofman <[email protected]>
…25621/refresh-token-token-cache
…ler/SNOW-1825621/refresh-token-token-cache
f4d206c to
dafeb5b
Compare
e920d82 to
984246e
Compare
Please answer these questions before submitting your pull requests. Thanks!
What GitHub issue is this PR addressing? Make sure that there is an accompanying issue to your PR.
Fixes SNOW-1825621
Fill out the following pre-review checklist:
Please describe how your code solves the related issue.
The last piece of the new OAuth code flow implementation.
The PR builds on top of SNOW-1825621 OAuth code flow PKCE support #2137 and SNOW-1825495 OAuth flows implementation #2135, so those should be merged before this one is reviewed.
I've added support for refresh token consumption and tested it. Unfortunately this is kind of useless until we introduce a OAUTH token cache, so that needs adding still.
(Optional) PR for stored-proc connector: